package com.humbleyuan.blogfront.mapper;

import com.humbleyuan.blogfront.entity.comment.CommentMain;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: HumbleYuan
 * @description:
 * @Date: 2019/8/9
 * @Time: 14:00
 * @Version: 1.0
 */
@Mapper
@Repository
public interface MainCommentMapper {

    /**
     * 获取所有留言板评论
     * 这里涉及到多表join(2个)，会降低效率吗
     * 先将vUser单独查
     *
     * @return list<CommentMain>
     */
    List<CommentMain> getRootCommentListsWithAllReplays();

    /**
     * 查询主评论中由多少不同用户的参与
     *
     * @return int
     */
    int getDifCommentUserNum();

    /**
     * 提交主评论
     *
     * @param cm
     * @return
     */
    int commitMainComment(CommentMain cm);

}
